//
//  WSMeiYouDianJiHeaderView.m
//  FD
//
//  Created by xiaofang wang on 2019/2/18.
//  Copyright © 2019年 ZhiYuan Network. All rights reserved.
//  h:40

#import "WSMeiYouDianJiHeaderView.h"
@interface WSMeiYouDianJiHeaderView()
/**餐品信息lb*/
@property (nonatomic, strong) UILabel *canpinmsgLb;
/**线*/
@property (nonatomic, strong) UIView *lightGrayLineView;

@end

@implementation WSMeiYouDianJiHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI {
    
    self.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.canpinmsgLb];
    [self addSubview:self.lightGrayLineView];
}
- (void)layoutSubviews {
    [super layoutSubviews];
    [self.canpinmsgLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(15);
        make.top.bottom.equalTo(self);
        make.right.equalTo(self.mas_right).offset(-15);
    }];
    
    [self.lightGrayLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(1);
        make.bottom.equalTo(self.canpinmsgLb.mas_bottom).offset(-1);
        make.left.right.equalTo(self.canpinmsgLb);
    }];
}


#pragma mark - getter
- (UILabel *)canpinmsgLb {
    if (!_canpinmsgLb) {
        _canpinmsgLb = [UILabel new];
        _canpinmsgLb.text = NSLocalizedString(Home_CanPinMsg, @"餐品信息");
    }
    return _canpinmsgLb;
}

- (UIView *)lightGrayLineView {
    if (!_lightGrayLineView) {
        _lightGrayLineView = [UIView new];
        _lightGrayLineView.backgroundColor = [UIColor rb_colorHex:0xf6f6f6];
    }
    return _lightGrayLineView;
}
@end
